package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class HelloController {

    // RESTful风格路径变量传参
    @GetMapping("/hello/{name}")
    public String hello(Model model,@PathVariable String name) {
        model.addAttribute("msg", "Hello, " + name);
        return "hello";
    }

}
